package com.tian.feign;

import com.tian.enums.ResultCode;
import com.tian.util.CommonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年05月11日 19:55
 * 博客地址：<a href="http://woaijava.cc/">博客地址</a>
 */
@Component
public class MessageTemplateFallBack implements FallbackFactory<MessageTemplateFeignClient> {

    @Override
    public MessageTemplateFeignClient create(Throwable throwable) {
        return queryUserReqDto -> CommonResult.failed(ResultCode.FALLBACK_FAILED);
    }
}